﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TotalCrytography
{
    
    public partial class ZipGUI : Form
    {
        List<String> _lstFile;
        String _Path;

        public ZipGUI(List<String> lstCurFile)
        {
            InitializeComponent();
            List<String> driveList = Environment.GetLogicalDrives().ToList();
            _lstFile = lstCurFile;
            String _Path = _lstFile[0].Substring(0, _lstFile[0].LastIndexOf('\\') + 1);

            tbPath.Text = _lstFile[0]+".zip";


            String[] hard = new string[] { "Store","Fastest","Fast","Normal","Good","Best"};
            cbLevel.DataSource = hard;
            cbLevel.SelectedIndex = 3;
        }

        private void btZip_Click(object sender, EventArgs e)
        {

            Zip.Zip.ZipFiles(_lstFile, tbPath.Text, tbPass.Text, cbLevel.SelectedIndex);
            DialogResult = DialogResult.OK;
            Close();
        }

        private void btBrowse_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog fd = new FolderBrowserDialog();
            if (fd.ShowDialog() == DialogResult.OK)
                tbPath.Text = fd.SelectedPath + "\\";
        }


        private void btExit_Click(object sender, EventArgs e)
        {
            Close();
        }

        
    }
}
